/**
 * @(#)SrmRspStatusCodeEnum.java, 2019/8/8.
 * <p/>
 * Copyright 2019 Netease, Inc. All rights reserved.
 * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.newsee.remote.common.enumeration;

/**
 * @author liangzhi.chen
 * @description srm供应商接口处理状态代码
 * @date 2019/8/8 下午 05:20
 **/
public enum SrmRspStatusCodeEnum {

    /**
     * 处理成功：S000
     */
    HANDLE_SUCCESS("S000", "处理成功"),

    /**
     * 处理失败(内部处理失败):E0M1
     */
    INTERNAL_ERROR("E0M1", "内部处理失败"),
    /**
     * 处理失败(发送方报文有误):E0Y1
     */
    SEND_MESSAGE_ERROR("E0Y1", "发送方报文有误");

    private String code;

    private String desc;

    SrmRspStatusCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public static String getTextByCode(String code) {
        for (SrmRspStatusCodeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type.getDesc();
            }
        }
        return null;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
